//
//  CollectionCycleCell.swift
//  CWLiving
//
//  Created by 方正刚 on 2017/7/11.
//  Copyright © 2017年 方正刚. All rights reserved.
//

import UIKit
import Kingfisher

class CollectionCycleCell: UICollectionViewCell {
    
    lazy var bgImageView: UIImageView = {
    
        let bgImageIView = UIImageView(frame: self.bounds)
            bgImageIView.image = UIImage(named: "Img_default")
        return bgImageIView
    
    }()
    
    var cycleModel: CycleModel? {
        
        didSet {
            
            guard let cycleM = cycleModel else {return}
            guard let cycleURL = NSURL(string: cycleM.pic_url) else { return }
            
            bgImageView.kf.setImage(with: cycleURL as URL)
            
            
        }
    }
    
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}


extension CollectionCycleCell {
    
    func setupUI() {
     
       contentView.addSubview(bgImageView)
        
    }

    
}

